package com.xueyi.aixihu.controller;

import com.xueyi.aixihu.controller.base.BaseController;
import com.xueyi.aixihu.entity.vo.DtAuthGroupTitleVo;
import com.xueyi.aixihu.entity.vo.SelectVo;
import com.xueyi.aixihu.response.base.BaseResponse;
import com.xueyi.aixihu.service.DtAreaManageService;
import com.xueyi.aixihu.service.DtAuthGroupService;
import com.xueyi.aixihu.service.DtUsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 描述 所有的下拉列表Controller（公用）
 *
 * @auther 俞烨
 * @date 2022-08-13 09
 */
@RestController
public class SelectVoController extends BaseController {


    @Autowired
    private DtAreaManageService dtAreaManageService;

    @Autowired
    private DtAuthGroupService dtAuthGroupService;

    @Autowired
    private DtUsersService dtUsersService;

    /**
     * 查询所有角色名
     *
     * @return 角色名
     */
    @RequestMapping("/dtAuthGroup/findAllAuthGroupTitle")
    public BaseResponse<List<SelectVo>> findAllAuthGroupTitle() {
        return dtAuthGroupService.findAllAuthGroupTitle();
    }

    /**
     * 下拉列表的用户类型  1：正常 0：游客
     *
     * @return
     */
    @RequestMapping("/dtUsers/findUsertype")
    public BaseResponse<List<SelectVo>> findUsertype() {
        return dtUsersService.findUsertype();
    }

    /**
     * 查询所有二级父类
     *
     * @return
     */
    @PostMapping("/findBy/parent")
    public BaseResponse<List<SelectVo>> findByParent() {
        BaseResponse<List<SelectVo>> response = dtAreaManageService.findByParent();
        return response;
    }
}
